package com.nervenets.shopping.hibernate.domain.common;

import com.nervenets.general.hibernate.DomainObject;
import com.nervenets.shopping.enumeration.UnionType;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 收藏
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Table
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Fav extends DomainObject {
    @ApiModelProperty(value = "关联类型")
    private UnionType type;
    @ApiModelProperty(value = "关联ID")
    private long unionId;

    ///
    @Transient
    private Object union;

    public Fav(UnionType type, long unionId) {
        this.type = type;
        this.unionId = unionId;
    }
}
